Conversation
…on family Three more PS-aligned selection tools join Marquee end-to-end: - **Lasso (L)**: drag to trace a freeform region; release to close. Path subsamples to ≥2 px between points to keep memory bounded. - **Polygonal Lasso**: click-by-click vertex chain with a rubber-band preview from the last vertex to the cursor. Click within 8 px of the first vertex (or hit Esc) to close. Vertex dots — orange first, white rest — make it obvious where you've clicked. - **Magic Wand (W)**: reuses the Paint Bucket's scanline flood fill; stores the bbox of the matched region as a rect selection. Tolerance is exposed in the options bar (0–128, slider + number). State changes: - `EditorState.selectionPath?: Point[]` — when present, refines the selection outline from the bbox rect to a closed polygon. Render adds a `drawSelectionPathChrome` helper (same black-halo + white-dashes marching-ants look as the marquee, but along an arbitrary path). - `serializeProject` round-trips `selectionPath` so polygon selections survive .json save / reload. - Cmd/Ctrl+D and the "Deselect" button now clear both `selection` and `selectionPath` (formerly only the rect). - Marquee commit explicitly clears `selectionPath` so a stale polygon doesn't outline a fresh rectangular selection. Canvas additions: - New interaction kinds: `lasso-drawing`, `polylasso-drawing`. - New imperative methods on `CanvasHandle`: `hasPendingPolyLasso` and `cancelPendingPolyLasso`, mirroring the existing crop pair so Esc in the parent's keyboard handler cancels the pending vertex chain cleanly. OptionsBar: - Marquee/Lasso/PolyLasso share one variant (hint + Deselect button) switched by `hintKey`. - Wand gets its own variant: tolerance number + range, hint, Deselect. i18n: new keys `lassoHint`, `polyLassoHint`, `wandHint`, `wandTolerance`, `wandEmpty` in both en and zh-CN. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three new selection tools + two PS-alignment UX fixes.
Selection tools (Lasso, Polygonal Lasso, Magic Wand)
State changes
EditorState.selectionPath?: Point[]— when present, refines the selection outline from the bbox rect to a closed polygon. Rendered via a newdrawSelectionPathChromehelper (black halo + white marching-ants dashes, identical look to the marquee but along an arbitrary path).serializeProjectround-tripsselectionPathso polygon selections survive .json save / reload.selectionandselectionPath(formerly only the rect). Marquee commit explicitly clearsselectionPathso a stale polygon doesn't outline a fresh rectangular selection.Canvas additions
lasso-drawing,polylasso-drawing.CanvasHandlegainshasPendingPolyLassoandcancelPendingPolyLasso, mirroring the existing crop pair so Esc in the parent's keyboard handler cancels the pending vertex chain cleanly.OptionsBar
UX fixes (bundled)
effectivePanMode = panMode || tool === 'hand'is wired into both Workspace and Canvas.i18n
New keys (en + zh-CN):
lassoHint,polyLassoHint,wandHint,wandTolerance,wandEmpty,handHint. UpdatedfocusEnterHint/focusExitHintto drop the F reference.Test plan
🤖 Generated with Claude Code